#ifndef MODEL_H
#define MODEL_H

#include <iostream>
#include <vector>
#include <GL/glew.h>
#include <glm.hpp>
#include <gtc/matrix_transform.hpp>
#include <stb_image.h>
#include <assimp/Importer.hpp>
#include <assimp/postprocess.h>
#include <assimp/scene.h>
#include <shader.h>

using namespace std;

string Setstr(const char * val);
#define enumtoStr(val) Setstr(#val)

struct Vertex{
    glm::vec3 Position;
    glm::vec3 Normal;
    glm::vec3 TexCoords;
};

struct Texture{
    enum TextureType{
        texture_diffuse,texture_specular,texture_normal,texture_height
    };
    unsigned int ID;
    TextureType Type;
    Texture(const string &path,TextureType type);
    void Use(unsigned int TextureID);
};

class Mesh{
public:
    vector<Vertex> vertices;
    vector<unsigned int> indices;
    vector<Texture> textures;

    Mesh(vector<Vertex> vertices, vector<unsigned int> indices, vector<Texture> textures);
    void Draw(Shader shader);
private:
    unsigned int VAO,VBO,EBO;
    void setupMesh();
};

#endif